<template>
	<view class="page">
		<topVue :title="$t('总人数')"></topVue>
		<view class="thVue flex align-center margin20 padding-row20">
			<view class="w40 text-left">{{ $t('地址') }}</view>
			<view class="w20 text-center">{{ $t('今日次数') }}({{ todaySum }})</view>
			<view class="w20 text-center">{{ $t('总次数') }}({{ totalSum }})</view>
			<view class="w20 text-center">{{ $t('有效账户') }}({{ activeSum }})</view>
		</view>
		<view class="tdVue flex align-center margin0 padding-row20" v-for="(item, index) in list" :key="index">
			<view class="w40 text-left">{{ item.name | addressFilter() }}</view>
			<view class="w20 text-center">{{ item.todayTimes }}</view>
			<view class="w20 text-center">{{ item.totalTimes }}</view>
			<view class="w20 text-center">{{ item.active==1 ? $t("是") : $t("否") }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				list: [],
        todaySum: 0,
        totalSum: 0,
        activeSum: 0,
			}
		},
		async onLoad() {
			await this.getList()
		},
		methods: {
			async getList(){
				const res = await this.$request("/front/user/teamList")
				if(res.code===0) {
          this.list = res.data.list
          this.todaySum = res.data.todaySum
          this.totalSum = res.data.totalSum
          this.activeSum = res.data.activeSum
        }
			}
		}
	}
</script>

<style lang="less" scoped>
	.thVue {
		width: 690rpx;
		height: 60rpx;
		background: #D7E3FD;
		border-radius: 4rpx;
		view {
			font-size: 24rpx;
			color: #8C929F;
		}
	}
	.tdVue {
		width: 690rpx;
		height: 60rpx;
		background: #FAFCFF;
		border-radius: 4rpx;
		view {
			font-size: 24rpx;
			color: #666666;
		}
	}
</style>
